Skip to content

Add support for discovery extensions #760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 7, 2025

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Apr 24, 2025

PR Summary

  • Add new subcommand to dsc to list extensions: dsc extension list
  • Add new ExtensionManifest which is similar but differs from ResourceManifest. Only discover capability currently supported.
  • Enhance existing discovery code to handle both resources and extensions. This includes pre-discoverying extensions when discovering resources since an extension may participate. This included a new enum to handle returning either resources or extensions.
  • Write extensions as table when used interactively
  • Rename existing functions to generalize for both resource and extension use, this also required making some private functions public

The output from a discovery extension must match:

{ "manifestPath": "<absolute path>" }

PR Context

Fix #681

@SteveL-MSFT SteveL-MSFT force-pushed the discovery-extension branch 3 times, most recently from 83825d3 to a9277d8 Compare April 24, 2025 20:20
@SteveL-MSFT SteveL-MSFT force-pushed the discovery-extension branch 2 times, most recently from 87a764c to 27e0ae6 Compare May 1, 2025 22:26
@michaeltlombardi
Copy link
Collaborator

Currently, the implementation requires returning the absolute path to a resource manifest - but I
can already see use cases for discovering extension manifests. For example, I might have
installed an extension from WinGet, and need to discover that, too.

Right now, it expects JSON like this:

{"resourceManifestPath":"/foo/bar/baz.dsc.resource.json"}

But we could have it return this, and parse the last segment of the path to determine kind:

{"absoluteManifestPath":"/foo/bar/baz.dsc.extension.json"}

Or require it return either resourceManifestPath or extensionManifestPath.

If we support extensions discovering extensions, we would need to recursively handle extension
discovery.

@SteveL-MSFT
Copy link
Member Author

I think we can defer extension discovery til when we need it

@SteveL-MSFT SteveL-MSFT force-pushed the discovery-extension branch from e1cdb55 to 233c3f5 Compare May 5, 2025 17:40
@SteveL-MSFT
Copy link
Member Author

Renamed from resourceManifestPath to just manifestPath to reuse extensions in the future. I don't think we need to prefix with absolute

@SteveL-MSFT SteveL-MSFT force-pushed the discovery-extension branch from 233c3f5 to 014a16f Compare May 6, 2025 02:18
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue May 7, 2025
Merged via the queue into PowerShell:main with commit f1be730 May 7, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the discovery-extension branch May 7, 2025 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discovery extension type resource
3 participants